
const resourceInfo = {
  state: {
    platform: localStorage.getItem('resourcePlatform') ? JSON.parse(localStorage.getItem('resourcePlatform')) : true, // 资源信息是否显示平台
    organization: localStorage.getItem('resourceOrganization') ? JSON.parse(localStorage.getItem('resourceOrganization')) : true, // 资源平台是否显示所属机构
    resourceId: localStorage.getItem('resourceId') ? JSON.parse(localStorage.getItem('resourceId')) : true // 资源信息是否显示资源id
  },
  mutations: {
    SET_PLATFORM: (state, boolean) => {
      state.platform = boolean;
      localStorage.setItem('resourcePlatform', boolean);
    },
    SET_ORGANIZATION: (state, boolean) => {
      state.organization = boolean;
      localStorage.setItem('resourceOrganization', boolean);
    },
    SET_RESOURCEID: (state, boolean) => {
      state.resourceId = boolean;
      localStorage.setItem('resourceId', boolean);
    }
  },
  actions: {
    PlatformChange({ commit }, isPlatform) {
      commit('SET_PLATFORM', isPlatform);
    },
    OriginzationChange({ commit }, isOrgan) {
      commit('SET_ORGANIZATION', isOrgan);
    },
    IdChange({ commit }, isId) {
      commit('SET_RESOURCEID', isId);
    }
  }

};

export default resourceInfo;
